<%@ page import="com.util.DbHeper" %>
<%@ page import="org.apache.ibatis.session.SqlSession" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.sql.DataSource" %>
<%@ page import="java.sql.Connection" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.mapper01.Book01Mapper" %>
<%@ page import="java.util.List" %>
<%@ page import="com.entity.Book" %>
<%@ page import="com.entity.Book01" %><%--
  Created by IntelliJ IDEA.
  User: webrx
  Date: 2017/6/22
  Time: 18:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
   /* //DbHeper db = new DbHeper();
    SqlSession ss= new DbHeper().getSession();
    Book01Mapper book = ss.getMapper(Book01Mapper.class);
     List<Book01> list = book.query();
    pageContext.setAttribute("book",list);
*/
%>
<%--<c:forEach items="${book}" var="book">
    ${book.name}<br>
</c:forEach>--%>
<hr>
<%
    Context initContext = new InitialContext();
    Context envContext = (Context) initContext.lookup("java:/comp/env");
    DataSource ds = (DataSource) envContext.lookup("jdbc/mysql");
    Connection conn = ds.getConnection();
    out.print(conn);
%>
</body>
</html>
